<?php
require 'include/global.php';
require_once 'include/train_db.php';
$smarty->compile_check = true;

if($_POST[contactemail]){
    $to = "support@enetrecruiter.com; svoline@yahoo.com";
    $content = '
			<html>
			<head>
			  <title>Contact Us</title>
			</head>
			<body>
			  <p>Name : '.$_POST[contactname].'</p>
			  <p>Email: '.$_POST[contactemail].'</p>
			  <p>Phone: '.$_POST[contactphone].'</p>
			  <p>Comments: '.$_POST[contactcomments].'</p>
			</body>
			</html>';
    $subject  = "Contact for".$_POST[contactsubject];
	$headers .= 'From: '.$_POST[contactname].' <'.$_POST[contactemail].'>' . "\r\n";
	$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    
	@mail($to, $subject, $content, $headers);
    echo "<script>alert('Your message has been sent. We will respond to you soon. Thank you!');
	window.location.href='index.php';
	</script>";
}

$smarty->display('header.tpl');
$smarty->display('left.tpl');
$smarty->display('contactus.tpl');
$smarty->display('right.tpl');
$smarty->display('footer.tpl');
?>
